package com.lwq.imserver.model.system;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.MongoId;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * Description:
 * Author: LiuWenQing
 * Datetime: 2022/1/20 15:40
 */
@Data
@Document(collection = "sys_user")
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    private String id;

    private String name;

    private String userName;

    private String password;

    private String avatar;

    private Integer age;

    private Integer sex;

    @JsonFormat(timezone= "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastLoginDate;

    private Boolean mutiLogin;

    @JsonFormat(timezone= "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createDate;

    @Transient
    private Boolean isOnline;

    private List<SysUser> friends;

}
